package com.situying.servlet.welcome;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class LoginServlet{

	
	private static final long serialVersionUID = 6753215246571841975L;
	
	@RequestMapping(value="/login",method=RequestMethod.POST )
	public String doLogin(@ModelAttribute LoginBean loginBean) {
		
		if(loginBean.getUserName().equals("vincent") && loginBean.getPassword().equals("123"))
		{
			return "homePage";
		}
		else
		{
			return "welcome";
		}
	}

}
